//
//  CellOfVideoClassify.m
//  To Feel
//
//  Created by 孙嘉胤 on 16/7/13.
//  Copyright © 2016年 caoyu. All rights reserved.
//

#import "CellOfVideoClassify.h"
#import "UIImageView+WebCache.h"
#import "ModelOfVideoClassify.h"
#import "ModelOfVideothird.h"
#import "Masonry.h"

@implementation CellOfVideoClassify

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
   
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        
        [self createSubViews];
        
    }
    
    return self;
}



- (void)createSubViews {
    
    self.imagepic = [[UIImageView alloc] init];
    [self.contentView addSubview:self.imagepic];

    
    self.imageOfPic = [[UIImageView alloc] init];
    [self.contentView addSubview:self.imageOfPic];
    
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    [self.imagepic mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView).with.offset(20);
        make.top.equalTo(self.contentView).with.offset(10);
        make.bottom.equalTo(self.contentView).with.offset( -10);
        make.width.offset(185);
    }];
    
    
    [self.imageOfPic mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).with.offset(10);
        make.bottom.equalTo(self.contentView).with.offset(-10);
        make.right.equalTo(self.contentView).with.offset(-20);
        make.left.equalTo(self.imagepic.mas_right).with.offset(10);
        
    }];
    

}

- (void)setModel:(ModelOfVideoClassify *)model {
    
    [self.imagepic sd_setImageWithURL:[NSURL URLWithString:model.photo] placeholderImage:nil];
    
}


- (void)setModel2:(ModelOfVideothird *)model2 {
    
    
    [self.imageOfPic sd_setImageWithURL:[NSURL URLWithString:model2.photo] placeholderImage:nil];
    
    
}






@end
